package org.hardstone.dao;

import org.hardstone.domain.BaseItemDomain;
import org.springframework.data.domain.Example;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.io.Serializable;
import java.util.List;
import java.util.Optional;

@NoRepositoryBean
public interface BaseDAO<T extends BaseItemDomain<PK>, PK extends Serializable> extends PagingAndSortingRepository<T, PK> {
    List<T> findAll(Example<T> ex);

    <S extends T> S save(S var1);

    <S extends T> Iterable<S> saveAll(Iterable<S> var1);

    Optional<T> findById(PK var1);

    boolean existsById(PK var1);

    Iterable<T> findAll();

    Iterable<T> findAllById(Iterable<PK> var1);

    PK count();

    void deleteById(PK var1);

    void delete(T var1);

    void deleteAll(Iterable<? extends T> var1);

    void deleteAll();

    void flush();

}

